const { Model } = require('../index');

class Note extends Model {
    static get tableName() {
        return 'note';
    }

    static get relationMappings() {

        return {
            // Create a mapping with the user model
            //  A note maps to a user_stock
            user_stock: {
                relation: Model.BelongsToOneRelation,
                modelClass: `${__dirname}/user_stock.js`,
                // Where the two are joined
                join: {
                    from: 'note.user_stock_id',
                    to: 'user_stock.id'
                }
            },
        };
    }
}

module.exports = Note;
//a = u.tableName;